{extend name="../template@default/forum_public"} {block name="content"}

<div class="mdui-col-xs-12 mdui-col-sm-8 mdui-col-offset-sm-2 mdui-m-y-1">
    <form>
        <h3>发布主题</h3>

        <div class="mdui-divider"></div>

        <div class="mdui-m-y-1">
            <select lay-ignore name="fid" class="mdui-select" mdui-select="{position: 'bottom'}" required>
                {volist name="forum" id="vo"}
                <option value="{$vo.fid}">{$vo.name}</option>
                {/volist}
            </select>
        </div>


        <div class="mdui-textfield mdui-m-b-1">
            <label class="mdui-textfield-label">标题</label>
            <input name="title" class="mdui-textfield-input" type="text" placeholder="title" max="60" required/>
        </div>

        <div id="editor">
        </div>
        <div class="mdui-m-y-1"></div>
        <input id="content" type="hidden" name="content" value="" required>
        <input id="files" type="hidden" name="files" value=""> {:token()}
        <button id="create" class="mdui-btn mdui-color-theme mdui-float-right">发布主题</button>
    </form>
    <div>
        <button class="mdui-btn layui-btn mdui-color-orange" id="file">
            <i class="mdui-icon material-icons">file_upload</i>上传附件</button>
        <div id="fileList" class="mdui-hidden-xs">
            <p>等待上传的附件队列(发布主题时自动上传)：</p>
        </div>
    </div>
</div>

{/block} {block name="js"}
<script src="__JS__/wangEditor.js"></script>
<script src="__JS__/mltree-editor.js"></script>
<script>
    var option = {
        uploadImg: "{:url('index/expand/picUpload')}",
        uploadFile: '{:url("index/expand/upload")}',
        uid: "{:session('uid')}",
        createUrl: '{:url("index/topic/create")}',
    }
    regEditor('def', option)
</script> {/block}